package cl.ccs.migracionbcmc.view.pagebean.sucdesa;

import javax.faces.context.FacesContext;

import oracle.adf.controller.ControllerContext;
import oracle.adf.controller.ViewPortContext;


public class ExceptionHandlerPageBean {
    public ExceptionHandlerPageBean() {
        super();
    }
    
    public void controllerExceptionHandler() {        
            ControllerContext context = ControllerContext.getInstance();
            ViewPortContext currentRootViewPort = context.getCurrentRootViewPort();
            Exception exceptionData = currentRootViewPort.getExceptionData();
            if (currentRootViewPort.isExceptionPresent()) {
                //exceptionData.printStackTrace();
                currentRootViewPort.clearException(); 
                
                FacesContext facesContext = FacesContext.getCurrentInstance();
                //facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, exceptionData.getMessage(), null));
            }
        }
}

